/**
 * Definition for singly-linked list.
 * struct ListNode {
 *     int val;
 *     struct ListNode *next;
 * };
 */
typedef struct ListNode ListNode;
struct ListNode* middleNode(struct ListNode* head)
{
    ListNode* pcur = head;
    int count = 0;
    ListNode* arr[200];
    while (pcur)
    {
        count++;
        arr[count] = pcur;
        pcur = pcur->next;
    }
    return arr[(count + 2) / 2];
}